package b_IO;

import org.testng.annotations.Test;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;


public class ByteStreamDemo3 {


    @Test
    public void test() throws IOException {
        FileOutputStream fos = new FileOutputStream("aa.txt");
        FileInputStream fis = new FileInputStream("a.txt");

        //读取文件的内容
        byte[] bs = new byte [1024];
        int len;
        while ((len = fis.read(bs)) != -1){
            fos.write(bs,0,len);
        }
    }
}
